import { createApp } from "vue";
import App from "./App.vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import router from "./router.js";
import Vant from "vant";
import axios from "axios";
import Ant from "ant-design-vue";
import "ant-design-vue/dist/reset.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import locale from "element-plus/es/locale/lang/zh-cn";

import * as echarts from "echarts";
// Vue.prototype.$echarts = echarts;

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// app.use(echarts);
app.config.globalProperties.$echarts = echarts;
app.use(Ant);
app.use(Vant);
app.use(ElementPlus, { locale: locale });
app.use(router);
app.mount("#app");
axios.defaults.baseURL = "/api";
